/* eslint no-undef: 0 */
/* eslint arrow-parens: 0 */
import React from 'react';
import Banner0 from './Banner0.tsx';
import Content0 from './Content0';
import Content3 from './Content3';
import Content5 from './Content5';
import Footer1 from './Footer1';
import Nav0 from './Nav0';

import {
  Banner01DataSource,
  Content00DataSource,
  Content30DataSource,
  Content50DataSource,
  Footer10DataSource,
  Nav00DataSource,
} from './data.source';
import './less/antMotionStyle.less';

let isMobile;
/*enquireScreen((b) => {
  isMobile = b;
});*/

const { location = {} } = typeof window !== 'undefined' ? window : {};

export default class Home extends React.Component<any, any> {
  constructor(props) {
    super(props);
    this.state = {
      isMobile,
    };
  }

  componentDidMount() {
    // 适配手机屏幕;
    /*    enquireScreen((b) => {
      this.setState({ isMobile: !!b });
    });*/
  }

  render() {
    const children = [
      <Nav0 id="Nav0_0" key="Nav0_0" dataSource={Nav00DataSource} isMobile={this.state.isMobile} />,
      <Banner0
        id="Banner0_1"
        key="Banner0_1"
        dataSource={Banner01DataSource}
        isMobile={this.state.isMobile}
      />,
      <Content0
        id="Product"
        key="Product"
        dataSource={Content00DataSource}
        isMobile={this.state.isMobile}
      />,
      <Content5
        id="Case"
        key="Case"
        dataSource={Content50DataSource}
        isMobile={this.state.isMobile}
      />,
      <Content3
        id="Company"
        key="Company"
        dataSource={Content30DataSource}
        isMobile={this.state.isMobile}
      />,
      <Footer1
        id="Footer1_0"
        key="Footer1_0"
        dataSource={Footer10DataSource}
        isMobile={this.state.isMobile}
      />,
    ];
    return (
      <div
        className="templates-wrapper"
        ref={(d) => {
          // this.dom = d;
        }}
      >
        {/* 如果不是 dva 2.0 替换成 {children} start */}
        {children}
        {/* 如果不是 dva 2.0 替换成 {children} end */}
      </div>
    );
  }
}
